#ifndef ORGANIZERWIDGET_H
#define ORGANIZERWIDGET_H
#include <QObject>
#include <QtGui>
#include <QWidget>
#include "actualdatamodel.h"
#include "dummydata.h"
#include "editdialog.h"
#include "settingsdialog.h"

class OrganizerWidget: public QWidget
{
    Q_OBJECT
public:
    static OrganizerWidget* getInstance()
    {
        OrganizerWidget* inst = 0;
        if(inst) return inst;
        else return (inst = new OrganizerWidget());
    }

    QSize sizeHint() const;
    QTreeWidgetItem* getCurrentDir() { return currentDir; }
    void refreshWidget();


private:
    OrganizerWidget();
    QTreeWidgetItem* currentDir;
    QString currentTag;
    //functions
    void createWidgets();
    void createMenu();
    //Widgets
    QTabWidget* tabWidget;
    QTreeWidget* treeView;
    QListWidget* tagView;
    QMenu* contextMenu;
    QAction* add;
    QAction* edit;
    QAction* del;

    QAction* addFolder;
    QAction* renameFolder;
    QAction* delFolder;

public slots:
    void tabChanged(int);
    void tagActivated (QListWidgetItem* item);
    void itemIsSelected(QTreeWidgetItem* item, int column);
    void itemIsDoubleClicked(QTreeWidgetItem*,int);
    void handleContextMenu(const QPoint& pt);
    void addItem();
    void deleteItem();
    void editItem();

    void addAFolder();
    void deleteAFolder();
    void renameAFolder();

};

#endif // ORGANIZERWIDGET_H
